<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <!--如果是IE 就以标准渲染-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <!-- 视窗——————响应式布局 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />

    <!--当前页面的三要素-->
    <title>运维系统-公共模板</title>
    <meta name="description" content="聚能优电" />
    <meta http-equiv="keywords" content="聚能优电" />
    <script type="text/javascript" src="./js/verify.js"></script>
    <!-- css -->
    <link rel="stylesheet" type="text/css" href="./css/common/common.css" />
    <link rel="stylesheet" type="text/css" href="./css/index.css" />
</head>

<body>
    <div id="container" class="bigbox">
        <div class="bigbox_01">
            <!--主屏内容-->
            <div class="screen">
                这是公共模板


            </div>
        </div>
    </div>


    <script>
        (function (win, doc) {
            var docEl = doc.documentElement || document.body; //获取HTML标签

            var container = doc.getElementById("container"); //container元素
            //判断是移动端设备还是PC,移动 就采用'orientationchange',横竖屏事件，PC端就采用onresize，窗口改变时间
            var resize =
                "onorientationchange" in win ? "orientationchange" : "resize";

            function rem() {
                docEl.style.fontSize = 100 * (container.clientWidth / 750) + "px";
            }

            //监听'DOMContent事件:DOM加载完成执行,如果DOMContent事件，那么执行rem函数
            doc.addEventListener("DOMContentLoaded", rem, false);

            //win下监听resize事件,如果resize事件，那么执行rem函数
            win.addEventListener(resize, rem, false);
        })(window, document);
    </script>
    <!-- js -->
    <script type="text/javascript" src="./js/jquery-3.4.1.js"></script>
    <script type="text/javascript" src="./js/swiper-3.4.2.min.js"></script>
    <script type="text/javascript" src="./layer/layer.js"></script>
    <script>
        $(document).ready(function () {

            $.ajax({
                type: "GET",
                dataType: "json",
                url: "http://112.74.169.99:21021/api/services/app/ControlDataService/GetListControlDataByID?id=11",
                beforeSend: function (xhr) {
                    xhr.setRequestHeader("Accept",
                        "application/json, text/javascript, */*; q=0.01"
                    );
                    xhr.setRequestHeader("Authorization", accessToken);
                    xhr.setRequestHeader('.AspNetCore.Culture',
                        'zh-Hans');
                },
                success: function (data) {
                    console.log("请求成功");
                },
                error: function (err) {
                    console.log("请求失败");
                }
            });

            function eachproject(obj) {
                var str = '';
                if (obj.constructor == Array) {
                    for (var i = 0, len = obj.length; i < len; i++) {
                        var obj_index = "";
                        var url = '';
                        if (i == 0) {
                            obj_index = '一';
                            url = 'mainmonitor_sz.html';
                        } else if (i == 1) {
                            obj_index = '二';
                            url = 'mainmonitor_egj.html';
                        } else if (i == 2) {
                            obj_index = '三';
                            url = 'mainmonitor_hz.html';
                        } else if (i == 3) {
                            obj_index = '四';
                        } else if (i == 4) {
                            obj_index = '五';
                        }
                        if (obj[i].status == '运行中') {
                            obj[i].status = '正常';
                        }
                        let datetime = new Date(obj[i].creatTime);
                        let
                            getFullYear = datetime.getFullYear();
                        let theMonth = datetime.getMonth() + 1;
                        let getMonth = theMonth <
                            10 ? '0' + theMonth : theMonth;
                        let getDate = datetime.getDate() < 10 ? '0' + datetime.getDate() :
                            datetime.getDate();
                        let obj_time = getFullYear + '-' + getMonth + '-' + getDate;
                        str += `<div class="l_con">`;
                        str += `<p class="xmlist">项目` + obj_index + `</p>`;
                        str += `<div class="xmtit">` + obj[i].projectNameCN + `</div>`;
                        str += `<div class="xmdata">`;
                        str += `<span class="d_status">` + obj[i].status + `</span>`;
                        str += `<span class="d_time">` + obj_time + `</span>`;
                        str += `<span class="d_name">` + obj[i].managerName + `</span>`;
                        str += `<span class="d_tel">18625931475</span>`;
                        str += `</div>`;
                        str += `<div class="xmaddress">`;
                        str += `<div class="a_icon"> <img src="./images/position.svg" alt=""></div>`;
                        str += `<div class="a_con">` + obj[i].province + obj[i].city + `</div>`;
                        str += `</div>`;
                        str +=
                            `<div class="xmdetail" onClick="window.location.href='` + url + `'">
                            `;
                        str += `<p>查看详情</p>`;
                        str += `</div>`;
                        str += `</div>`;

                    }
                    return str;
                }
            }





        });
    </script>

</body>

</html>